<?php
    $this->load->view('template/header');
?>
        <script>
	$(function() {
            $( "#waktumulai" ).datepicker();
            $( "#waktuselesai" ).datepicker();
            $("#waktumulai").datepicker( "option", "dateFormat", "yy-mm-dd" );
            $("#waktuselesai").datepicker( "option", "dateFormat", "yy-mm-dd" );
	});
	</script>
            <h1><?=$title?></h1>                    
            <?php echo form_open_multipart('pengumuman/pengumuman/tambah_pengumuman');?>
                <table>
                    <tr>
                        <td>Judul Pengumuman</td>
                        <td>
                            <input type="text" name="judul" size="30"/>
                        </td>
                        <td>
                            <?php echo form_error('judul'); ?>
                        </td>
                    </tr>
                    <tr>
                        <td>Deskripsi Pengumuman</td>
                        <td>
                            <textarea name="deskripsi" cols="24"></textarea>
                        </td>
                        <td>
                            <?php echo form_error('deskripsi'); ?>
                        </td>
                    </tr>
                    <tr>
                        <td>Mulai Pengumuman</td>
                        <td>
                            <input type="text" name="mulai" size="30" id="waktumulai" />
                            pukul <select name="jammulai">
                                    <?php
                                        for($i=0; $i<24; $i++){
                                            if(strlen($i)==1){
                                                $a = '0'.$i;
                                            }else{$a = $i;}
                                            echo('<option value='.$i.'>'.$a.'</option>');
                                        }
                                    ?>
                                  </select><select name="menitmulai">
                                    <?php
                                        $i = 0;
                                        while($i<60){
                                            if(strlen($i)==1){
                                                $a = '0'.$i;
                                            }else{$a = $i;}
                                            echo('<option value='.$i.'>'.$a.'</option>');
                                            $i = $i +5;
                                        }
                                    ?>
                                </select>
                        </td>
                        <td>
                            <?php echo form_error('mulai'); ?>
                        </td>
                    </tr>
                    <tr>
                        <td>Selesai Pengumuman</td>
                        <td>
                            <input type="text" name="selesai" size="30" id="waktuselesai"/>
                             pukul <select name="jamselesai">
                                    <?php
                                        for($i=0; $i<24; $i++){
                                            if(strlen($i)==1){
                                                $a = '0'.$i;
                                            }else{$a = $i;}
                                            echo('<option value='.$i.'>'.$a.'</option>');
                                        }
                                    ?>
                                  </select><select name="menitselesai">
                                    <?php
                                        $i = 0;
                                        while($i<60){
                                            if(strlen($i)==1){
                                                $a = '0'.$i;
                                            }else{$a = $i;}
                                            echo('<option value='.$i.'>'.$a.'</option>');
                                            $i = $i +5;
                                        }
                                    ?>
                                </select>
                        </td>
                        <td>
                            <?php echo form_error('selesai'); ?>
                        </td>
                    </tr>
                    <tr>
                        <td>Jenis Pengumuman</td>
                        <td>
                            <select name="jenis">
                                <option value="1">Text</option>
                                <option value="2">Multimedia</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            File Multimedia
                        </td>
                        <td>
                            <input type="file" name="userfile" size="30"/>   
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <right><input type="submit" value="Submit"/></right>
                        </td>
                    </tr>
                </table>
            <?=form_close()?>
 <?php
    $this->load->view('template/footer');
?>
